package cz.cvut.fit.web.nakupniSeznam.data;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

@Entity (name = "item")
@NamedQueries({
	@NamedQuery(name="item.getAll", query="SELECT i FROM item i"),
	@NamedQuery(name="item.getByList", query="SELECT i FROM item i WHERE i.listId= :listId")
})
public class Item implements IEntity{

	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	

	private String name;
	
	private Integer quantity;
	
	private Long creationDate;
	
	private Long lastChanged;
	
	private Long lastPicked;
	
	private Integer marked;
	
	private Long categoryId;
	
	private Long unitId;
	
	private Long listId;

	
	@Override
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getQuantity() {
		return quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	public Long getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(Long creationDate) {
		this.creationDate = creationDate;
	}

	public Long getLastChanged() {
		return lastChanged;
	}

	public void setLastChanged(Long lastChanged) {
		this.lastChanged = lastChanged;
	}

	public Long getLastPicked() {
		return lastPicked;
	}

	public void setLastPicked(Long lastPicked) {
		this.lastPicked = lastPicked;
	}

	public Long getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(Long categoryId) {
		this.categoryId = categoryId;
	}

	public Long getUnitId() {
		return unitId;
	}

	public void setUnitId(Long unitId) {
		this.unitId = unitId;
	}

	public Long getListId() {
		return listId;
	}

	public void setListId(Long listId) {
		this.listId = listId;
	}

	public Integer getMarked() {
		return marked;
	}

	public void setMarked(Integer marked) {
		this.marked = marked;
	}
}
